import Vue from 'vue';
import Router from 'vue-router';
import Index from './views/Index.vue';
import Main from './views/Main.vue';
import Mall from './views/Mall.vue';
import Friend from './views/Friend.vue';
import ChatList from './views/ChatList.vue';
import Mine from './views/Mine.vue';
import MatchmakerMine from './views/MatchmakerMine.vue';

Vue.use(Router);
const vueRouter = new Router({
    mode: 'hash',
    base: process.env.BASE_URL,
    routes: [
        {
            path: '/',
            component: Index,
            meta: {
                requireAuth: true,
            },
            children: [
                {
                    name: 'main',
                    path: '/',
                    component: Main,
                    meta: {
                        loginAuth: true,
                        title: '首页',
                        keepAlive: true,
                    },
                }, {
                    name: 'mall',
                    path: '/mall',
                    component: Mall,
                    meta: {
                        loginAuth: true,
                        title: '商城',
                        keepAlive: true,
                    },
                }, {
                    name: 'friend',
                    path: '/friend',
                    component: Friend,
                    meta: {
                        loginAuth: true,
                        title: '交友',
                        keepAlive: true,
                    },
                }, {
                    name: 'chatList',
                    path: '/chatList',
                    component: ChatList,
                    meta: {
                        loginAuth: true,
                        title: '聊天',
                        keepAlive: true,
                    },
                },
                {
                    name: 'mine',
                    path: '/mine',
                    component: Mine,
                    meta: {
                        loginAuth: true,
                        title: '我的',
                        keepAlive: true,
                    },
                },
                {
                    name: 'matchmakerMine',
                    path: '/matchmakerMine',
                    component: MatchmakerMine,
                    meta: {
                        loginAuth: true,
                        title: '我的',
                        keepAlive: true,
                    },
                },
            ],
        },
        {
            path: '/chat/detail',
            name: 'chatDetail',
            component: () => import(/* webpackChunkName: "chatDetail" */ './views/ChatDetail.vue'),
            meta: {
                loginAuth: true,
                title: '正在聊天',
            },
        },
        {
            path: '/locationInformation',
            name: 'locationInformation',
            component: () => import(/* webpackChunkName: "LocationInformation" */ './views/LocationInformation.vue'),
            meta: {
                loginAuth: true,
                title: '位置信息',
            },
        },
        {
            path: '/product/list',
            name: 'productList',
            component: () => import(/* webpackChunkName: "productList" */ './views/ProductList.vue'),
            meta: {
                title: '商品列表',
            },
        },
        {
            path: '/product/detail',
            name: 'productDetail',
            component: () => import(/* webpackChunkName: "productDetail" */ './views/ProductDetail.vue'),
            meta: {
                title: '商品详情',
            },
        },
        {
            path: '/product/category',
            name: 'productCategory',
            component: () => import(/* webpackChunkName: "productCategory" */ './views/ProductCategory.vue'),
            meta: {
                title: '商品分类',
            },
        },
        {
            path: '/product/comment',
            name: 'productComment',
            component: () => import(/* webpackChunkName: "productComment" */ './views/ProductComment.vue'),
            meta: {
                title: '商品评价',
            },
        },
        {
            path: '/loginRegister',
            name: 'loginRegister',
            component: () => import(/* webpackChunkName: "loginRegister" */ './views/LoginRegister.vue'),
            meta: {
                title: '登录注册',
                keepAlive: false,
            },
        },
        {
            name: 'friendInfo',
            path: '/friendInfo',
            component: () => import(/* webpackChunkName: "friendInfo" */ './views/FriendInfo.vue'),
            meta: {
                loginAuth: true,
                title: '交友信息',
            },
        },
        {
            name: 'orderConfirm',
            path: '/order/confirm',
            component: () => import(/* webpackChunkName: "orderConfirm" */ './views/OrderConfirm.vue'),
            meta: {
                loginAuth: true,
                title: '订单确认',
            },
        },
        {
            name: 'orderChannel',
            path: '/order/channel',
            component: () => import(/* webpackChunkName: "orderChannel" */ './views/OrderChannel.vue'),
            meta: {
                loginAuth: true,
                title: '选择支付方式',
            },
        },
        {
            name: 'orderList',
            path: '/order/list',
            component: () => import(/* webpackChunkName: "orderList" */ './views/OrderList.vue'),
            meta: {
                loginAuth: true,
                title: '订单列表',
                keepAlive: true,
            },
        },
        {
            name: 'orderDetail',
            path: '/order/detail',
            component: () => import(/* webpackChunkName: "orderDetail" */ './views/OrderDetail.vue'),
            meta: {
                loginAuth: true,
                title: '订单详情',
            },
        },
        {
            name: 'orderComment',
            path: '/order/comment',
            component: () => import(/* webpackChunkName: "orderComment" */ './views/OrderComment.vue'),
            meta: {
                loginAuth: true,
                title: '发表评论',
            },
        },
        {
            name: 'addressList',
            path: '/address/list',
            component: () => import(/* webpackChunkName: "addressList" */ './views/AddressList.vue'),
            meta: {
                loginAuth: true,
                title: '收货地址',
                keepAlive: true,
            },
        },
        {
            name: 'addressEdit',
            path: '/address/edit',
            component: () => import(/* webpackChunkName: "addressEdit" */ './views/AddressEdit.vue'),
            meta: {
                loginAuth: true,
                title: '编辑收货地址',
            },
        },
        {
            name: 'mineAlbum',
            path: '/mine/album',
            component: () => import(/* webpackChunkName: "mineAlbum" */ './views/MineAlbum.vue'),
            meta: {
                loginAuth: true,
                title: '我的相册',
            },
        },
        {
            name: 'mineData',
            path: '/mine/data',
            component: () => import(/* webpackChunkName: "mineData" */ './views/MineData.vue'),
            meta: {
                loginAuth: true,
                title: '我的资料',
                // keepAlive: true,
            },
        },
        {
            name: 'mineDataEdit',
            path: '/mine/data/edit',
            component: () => import(/* webpackChunkName: "mineDataEdit" */ './views/MineDataEdit.vue'),
            meta: {
                loginAuth: true,
                title: '编辑资料',
                keepAlive: true,
            },
        },
        {
            name: 'mineBaseDataInit',
            path: '/mine/baseDataInit',
            component: () => import(/* webpackChunkName: "mineBaseDataInit" */ './views/MineBaseDataInit.vue'),
            meta: {
                loginAuth: true,
                title: '基本信息',
            },
        },
        {
            name: 'mineIntroduce',
            path: '/mine/introduce',
            component: () => import(/* webpackChunkName: "mineIntroduce" */ './views/MineIntroduce.vue'),
            meta: {
                loginAuth: true,
                title: '编辑自我介绍',
                keepAlive: true,
            },
        },
        {
            name: 'mineHobby',
            path: '/mine/hobby',
            component: () => import(/* webpackChunkName: "mineHobby" */ './views/MineHobby.vue'),
            meta: {
                loginAuth: true,
                title: '兴趣爱好',
                keepAlive: true,
            },
        },
        {
            name: 'whoLookMe',
            path: '/mine/whoLookMe',
            component: () => import(/* webpackChunkName: "whoLookMe" */ './views/WhoLookMe.vue'),
            meta: {
                loginAuth: true,
                title: '谁看过我',
            },
        },
        {
            name: 'whoLikeMe',
            path: '/mine/whoLikeMe',
            component: () => import(/* webpackChunkName: "whoLikeMe" */ './views/WhoLikeMe.vue'),
            meta: {
                loginAuth: true,
                title: '谁喜欢我',
            },
        },
        {
            name: 'ILikeWho',
            path: '/mine/iLikeWho',
            component: () => import(/* webpackChunkName: "ILikeWho" */ './views/ILikeWho.vue'),
            meta: {
                loginAuth: true,
                title: '我喜欢谁',
            },
        },
        {
            name: 'eachOtherLike',
            path: '/mine/eachOtherLike',
            component: () => import(/* webpackChunkName: "eachOtherLike" */ './views/EachOtherLike.vue'),
            meta: {
                loginAuth: true,
                title: '相互喜欢',
            },
        },
        {
            name: 'mineIncome',
            path: '/mine/income',
            component: () => import(/* webpackChunkName: "mineIncome" */ './views/MineIncome.vue'),
            meta: {
                loginAuth: true,
                title: '我的收益',
            },
        },
        {
            name: 'mineMoneyBill',
            path: '/mine/moneyBill',
            component: () => import(/* webpackChunkName: "mineMoneyBill" */ './views/MineMoneyBill.vue'),
            meta: {
                loginAuth: true,
                title: '现金积分明细',
            },
        },
        {
            name: 'mineShoppingBill',
            path: '/mine/mineShoppingBill',
            component: () => import(/* weminebpackChunkName: "mineShoppingBill" */ './views/MineShoppingBill.vue'),
            meta: {
                loginAuth: true,
                title: '购物积分明细',
            },
        },
        {
            name: 'mineMoneyWithdrawal',
            path: '/mine/moneyWithdrawal',
            component: () => import(/* webpackChunkName: "mineMoneyWithdrawal" */ './views/MineMoneyWithdrawal.vue'),
            meta: {
                loginAuth: true,
                title: '现金积分提现',
            },
        },
        {
            name: 'mineMoneyRecharge',
            path: '/mine/moneyRecharge',
            component: () => import(/* webpackChunkName: "mineMoneyRecharge" */ './views/MineMoneyRecharge.vue'),
            meta: {
                loginAuth: true,
                title: '现金积分充值',
            },
        },
        {
            name: 'mineBankCard',
            path: '/mine/bankCard',
            component: () => import(/* webpackChunkName: "mineBankCard" */ './views/MineBankCard.vue'),
            meta: {
                loginAuth: true,
                title: '我的银行卡',
            },
        },
        {
            name: 'mineBankCardAdd',
            path: '/mine/bankCardAdd',
            component: () => import(/* webpackChunkName: "mineBankCardAdd" */ './views/MineBankCardAdd.vue'),
            meta: {
                loginAuth: true,
                title: '添加银行卡',
            },
        },
        {
            name: 'mineMemberRank',
            path: '/mine/memberRank',
            component: () => import(/* webpackChunkName: "mineMemberRank" */ './views/MineMemberRank.vue'),
            meta: {
                loginAuth: true,
                title: '会员升级',
            },
        },
        {
            name: 'mineFans',
            path: '/mine/mineFans',
            component: () => import(/* webpackChunkName: "mineFans" */ './views/MineFans.vue'),
            meta: {
                loginAuth: true,
                title: '我的粉丝',
            },
        },
        {
            name: 'logisticsDetail',
            path: '/order/logistics',
            component: () => import(/* webpackChunkName: "logisticsDetail" */ './views/LogisticsDetail.vue'),
            meta: {
                loginAuth: true,
                title: '物流详情',
            },
        },
        {
            name: 'mineAvatarAndSex',
            path: '/mine/avatarAndSex',
            component: () => import(/* webpackChunkName: "mineAvatarAndSex" */ './views/MineAvatarAndSex.vue'),
            meta: {
                loginAuth: true,
                title: '完善头像和性别',
            },
        },
        {
            name: 'mineRealNameAuthentication',
            path: '/mine/authentication',
            component: () => import(/* webpackChunkName: "mineRealNameAuthentication" */ './views/MineRealNameAuthentication.vue'),
            meta: {
                loginAuth: true,
                title: '实名认证',
            },
        },
        {
            name: 'mineGiftLog',
            path: '/min/giftLog',
            component: () => import(/* webpackChunkName: "mineGiftLog" */ './views/MineGiftLog.vue'),
            meta: {
                loginAuth: true,
                title: '我的礼物',
            },
        },
        {
            name: 'setting',
            path: '/setting',
            component: () => import(/* webpackChunkName: "setting" */ './views/Setting.vue'),
            meta: {
                loginAuth: true,
                title: '设置',
            },
        },
        {
            name: 'settingNotification',
            path: '/setting/notification',
            component: () => import(/* webpackChunkName: "settingNotification" */ './views/SettingNotification.vue'),
            meta: {
                loginAuth: true,
                title: '通知设置',
            },
        },
        {
            name: 'settingSoundAndShock',
            path: '/setting/soundAndShock',
            component: () => import(/* webpackChunkName: "settingSoundAndShock" */ './views/SettingSoundAndShock.vue'),
            meta: {
                loginAuth: true,
                title: '声音和震动',
            },
        },
        {
            name: 'shoppingCart',
            path: '/shoppingCart',
            component: () => import(/* webpackChunkName: "shoppingCart" */ './views/ShoppingCart.vue'),
            meta: {
                loginAuth: true,
                title: '购物车',
            },
        },
        {
            name: 'mineShare',
            path: '/mine/share',
            component: () => import(/* webpackChunkName: "mineShare" */ './views/MineShare.vue'),
            meta: {
                loginAuth: true,
                title: '我的分享',
                keepAlive: true,
            },
        },
        {
            name: 'mineMatchmaker',
            path: '/mine/matchmaker',
            component: () => import(/* webpackChunkName: "mineMatchmaker" */ './views/MineMatchmaker.vue'),
            meta: {
                loginAuth: true,
                title: '我的红娘牵线',
                keepAlive: true,
            },
        },
        {
            name: 'matchmakerDetail',
            path: '/mine/matchmaker/detail',
            component: () => import(/* webpackChunkName: "matchmakerDetail" */ './views/MatchmakerDetail.vue'),
            meta: {
                loginAuth: true,
                title: '红娘详情',
            },
        },
        {
            name: 'matchmakerMineData',
            path: '/matchmaker/data',
            component: () => import(/* webpackChunkName: "matchmakerMineData" */ './views/MatchmakerMineData.vue'),
            meta: {
                loginAuth: true,
                title: '我的资料',
            },
        },
        {
            name: 'matchmakerRank',
            path: '/matchmaker/rank',
            component: () => import(/* webpackChunkName: "matchmakerRank" */ './views/MatchmakerRank.vue'),
            meta: {
                loginAuth: true,
                title: '红娘会员升级',
            },
        },
        {
            name: 'matchmakerDataEdit',
            path: '/matchmaker/data/edit',
            component: () => import(/* webpackChunkName: "matchmakerDataEdit" */ './views/MatchmakerDataEdit.vue'),
            meta: {
                loginAuth: true,
                title: '编辑资料',
            },
        },
        {
            name: 'matchmakerSingleGroup',
            path: '/matchmaker/SingleGroup',
            component: () => import(/* webpackChunkName: "matchmakerSingleGroup" */ './views/MatchmakerSingleGroup.vue'),
            meta: {
                loginAuth: true,
                title: '我的单身团',
                keepAlive: true,
            },
        },
        {
            name: 'singleInfo',
            path: '/singleInfo',
            component: () => import(/* webpackChunkName: "singleInfo" */ './views/SingleInfo.vue'),
            meta: {
                loginAuth: true,
                title: '单身资料详情',
            },
        },
        {
            name: 'matchRecord',
            path: '/matchRecord',
            component: () => import(/* webpackChunkName: "matchRecord" */ './views/MatchRecord.vue'),
            meta: {
                loginAuth: true,
                title: '红娘牵线记录',
            },
        },
        {
            name: 'loveArticle',
            path: '/loveArticle',
            component: () => import(/* webpackChunkName: "loveArticle" */ './views/LoveArticle.vue'),
            meta: {
                loginAuth: true,
                title: '情感空间',
            },
        },
        {
            name: 'articleDetail',
            path: '/articleDetail',
            component: () => import(/* webpackChunkName: "articleDetail" */ './views/ArticleDetail.vue'),
            meta: {
                loginAuth: true,
                title: '文章详情',
            },
        },
        {
            name: 'appDownload',
            path: '/appDownload',
            component: () => import(/* webpackChunkName: "articleDetail" */ './views/AppDownload.vue'),
            meta: {
                title: 'app下载',
            },
        },
        {
            name: 'scanCode',
            path: '/scanCode',
            component: () => import(/* webpackChunkName: "articleDetail" */ './views/ScanCode.vue'),
            meta: {
                title: '扫描二维码',
            },
        },
        {
            name: 'about',
            path: '/about',
            component: () => import(/* webpackChunkName: "about" */ './views/About.vue'),
            meta: {
                title: '关于心相依',
            },
        },
        {
            name: 'onlineArticle',
            path: '/onlineArticle',
            component: () => import(/* webpackChunkName: "onlineArticle" */ './views/OnlineArticle.vue'),
            meta: {
                title: '相关文章',
            },
        },
        {
            name: 'accountAndSecurity',
            path: '/accountAndSecurity',
            component: () => import(/* webpackChunkName: "accountAndSecurity" */ './views/AccountAndSecurity.vue'),
            meta: {
                title: '账号与安全',
                loginAuth: true,
            },
        },
        {
            name: 'settingPassword',
            path: '/setting/password',
            component: () => import(/* webpackChunkName: "settingPassword" */ './views/SettingPassword.vue'),
            meta: {
                title: '修改密码',
                loginAuth: true,
            },
        },
        {
            name: 'businessApplication',
            path: '/business/application',
            component: () => import(/* webpackChunkName: "businessApplication" */ './views/BusinessApplication.vue'),
            meta: {
                title: '商户入驻',
                loginAuth: true,
            },
        },
        {
            name: 'forgetPassword',
            path: '/forgetPassword',
            component: () => import(/* webpackChunkName: "forgetPassword" */ './views/ForgetPassword.vue'),
            meta: {
                title: '忘记密码',
            },
        },
        {
            name: 'chatLog',
            path: '/chat/log',
            component: () => import(/* webpackChunkName: "chatLog" */ './views/ChatLog.vue'),
            meta: {
                title: '查看聊天记录',
            },
        },
        {
            name: 'expertList',
            path: '/expert/list',
            component: () => import(/* webpackChunkName: "expertList" */ './views/ExpertList.vue'),
            meta: {
                title: '专家列表',
                loginAuth: true,
            },
        },
        {
            name: 'minePartnerAgentRecord',
            path: '/mine/partnerAgentRecord',
            component: () => import(/* webpackChunkName: "minePartnerAgentRecord" */ './views/MinePartnerAgentRecord.vue'),
            meta: {
                title: '佣金明细',
                loginAuth: true,
            },
        },
        {
            name: 'messageList',
            path: '/messageList',
            component: () => import(/* webpackChunkName: "messageList" */ './views/MessageList.vue'),
            meta: {
                loginAuth: true,
                title: '系统通知',
            },
        },
        {
            name: 'messageDetail',
            path: '/messageDetail',
            component: () => import(/* webpackChunkName: "messageDetail" */ './views/MessageDetail.vue'),
            meta: {
                loginAuth: true,
                title: '消息详情',
            },
        },
        {
            name: 'matchmakerFans',
            path: '/matchmakerFans',
            component: () => import(/* webpackChunkName: "matchmakerFans" */ './views/MatchmakerFans.vue'),
            meta: {
                loginAuth: true,
                title: '我的粉丝',
            },
        },
        {
            path: '*',
            redirect: '/',
        },
    ],
});
export default vueRouter;
